package cn.wolfcode.luowowo.repository;

import cn.wolfcode.luowowo.domain.Strategy;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface StrategyRepository extends MongoRepository<Strategy, String> {

    /**
     * 根据攻略分类的id查该分类下的所有的攻略文章
     * @param catalogId
     * @return
     */
    List<Strategy> findByCatalogId(String catalogId);

    //根据目的地的id查询阅读量前三的攻略
    List<Strategy> findByDestId(String destId, PageRequest of);

    //通过目的地名字查询攻略
    List<Strategy> findByDestName(String destName);


}
